﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace _220105BookSys.Model
{
    public class Book
    {
        //[Key]
        public Guid Id { get; set; }

        [Required]
        [Display(Name ="书籍名称"),StringLength(20,ErrorMessage ="长度4-20",MinimumLength =4)]
        [Column(TypeName ="nvarchar(20)")]
        public string Name { get; set; }

        [Required]
        [Display(Name = "书籍简介"), StringLength(200, ErrorMessage = "长度4-200", MinimumLength = 4)]
        [Column(TypeName ="nvarchar(200)")]
        public string Describe { get; set; }

        [ForeignKey(nameof(BookType))]
        public Guid BookTypeId { get; set; }
        public BookType BookType { get; set; }
    }
}
